package com.example.demo.study;

public class styudy01 {
    //hello world
    public static void main(String[] args) {
      // 创建外部类对象

      styudy01 outer = new styudy01();
        // 创建内部类对象
      MathUtils mathUtils = outer.new MathUtils();

      // 调用内部类方法
      int result = mathUtils.add(1, 2);

      System.out.println("result = " + result);
    }
    public  class MathUtils {
        public int add(int a, int b) {
            return a + b;
        }

        public double add(double a, double b) {
            return a + b;
        }
    }
}



